#!/bin/bash
#array_ip=(192.168.1.1 192.168.1.2 192.168.1.3 192.168.1.4 192.168.1.5 192.168.1.6 192.168.1.253)
#for _ip in ${array_ip[@]};
#do
#	echo $_ip
#	_delay=`ping -c 1 $_ip | grep "time=" | awk -F '=' '{print $4}' | awk '{print $1}'`
#	if [ ! -n "$_delay" ];then
#		#echo "delay is null"
#		_delay=0
#		#echo "$_delay"
#	fi
#	echo $_delay
#done

_delay=`ping -c 1 $1 | grep "time=" | awk -F '=' '{print $4}' | awk '{print $1}'`
if [ ! -n "$_delay" ];then
	_delay=0
fi
echo $_delay
